import request from './request'
export function login(account: string, password: string) {
  return request({
    method: 'post',
    url: '/auth/login',
    params: {
      userMail: account,
      password: password
    }
  })
}
export function sendMailVerificationCode(userMail: string, flag: boolean) {
  return request({
    method: 'post',
    url: `/auth/getMailVerificationCode`,
    params: {
      userMail: userMail,
      flag: flag
    }
  })
}
export function register(userMail: string, password: string, code: string, role: string) {
  return request({
    method: 'post',
    url: `/auth/signUp`,
    params: {
      userMail: userMail,
      password: password,
      mailVerificationCode: code,
      signUpRole: role
    }
  })
}
export function updatePassword(verificationCode: string, userMail: string, newPassword: string) {
  return request({
    method: 'patch',
    url: `/auth/updatePassword`,
    params: {
      verificationCode: verificationCode,
      userMail: userMail,
      newPassword: newPassword
    }
  })
}
